package com.teen9g.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ChatMessage implements Serializable {
    @TableId(value = "message_id", type = IdType.AUTO)
    private Integer messageId;
    private String chatId; // 关联的聊天ID
    private Integer senderId;
    private String senderName;
    private Integer receiverId;
    private String receiverName;
    private String messageContent;
    private String messageStatus; // 未读/已读/撤回/删除
    private Boolean deletedBySender; //是否被发送方删除
    private Boolean deletedByReceiver; //是否被接收方删除
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime sendTime;
}
